pub fn convert_base(num_str: &str, to_base: u32) -> String {
    // 解析输入字符串，提取数字部分和源基数
    let parts: Vec<&str> = num_str.split('(').collect();
    // 
    if parts.len() != 2 || !parts[1].ends_with(')') {
        panic!("Invalid input format");
    }
    let number_part = parts[0];
    
    let from_base: u32 = parts[1][..parts[1].len() - 1].parse().expect("Invalid base format");

    // 将数字从源基数转换为十进制
    let decimal_number = isize::from_str_radix(number_part, from_base).expect("Invalid number format");

    // 定义目标基数的数字字符集
    let digits = "0123456789abcdef";

    // 将十进制数转换为目标基数
    let mut result = String::new();
    let mut number = decimal_number;

    while number > 0 {
        let remainder = number % to_base as isize;
        result = digits.chars().nth(remainder as usize).unwrap().to_string() + &result;
        number /= to_base as isize;
    }

    if result.is_empty() {
        result.push('0');
    }

    result
}